/*
package com.weiyan.server.impl;

import com.weiyan.dao.ProductDao;
import com.weiyan.domian.Product;
import com.weiyan.server.ProductServer;
import io.seata.core.context.RootContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

*/
/**
 * @author misterWei
 * @create 2020年02月20号:20点20分
 * @mailbox mynameisweiyan@gmail.com
 *//*

*/
/*
@Service("ProductServerImpl")
*//*

@Slf4j
public class ProductServerImpl implements ProductServer {

    @Autowired
    private ProductDao productDao;

    @Override
    @Transactional(readOnly = true)
    public Product findByPid(Integer pid) {
        return productDao.findById(pid).get();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void decrement(Integer pid){
        productDao.decrement(pid);
        log.error(RootContext.getXID());
        if (pid.equals(2)) {
            throw new RuntimeException("自定义异常...");
        }


    }
}
*/
